package stage2;

import java.util.Scanner;

public class check6_2 {
    public static void main(String[] args) {
        for (int i=0;;i++) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入2-10之间的数字");
            int num = sc.nextInt();
            if (2 <= num && num <= 10) {
                //计算规律数字
                int sum=0;
                String title="";
                for (int j=0;j<=num;j++){
                    sum+=Math.pow(2,j);
                    title=title+"+"+"2"+j;
                }
                title+="=";
                System.out.println(title+sum);
            } else {
                System.out.println("输入错误，请重新输入数字");
            }
        }
    }
}
